/*********************************************************************************
 *      Copyright:  (C) 2017 luminqi
 *                  All rights reserved.
 *
 *       Filename:  linker.c
 *    Description:  This file 
 *                 
 *        Version:  1.0.0(2017年08月23日)
 *         Author:  luminqi <958822582@qq.com>
 *      ChangeLog:  1, Release initial version on "2017年08月23日 00时21分52秒"
 *                 
 ********************************************************************************/

#include "linker.h"

int main(int argc, char **argv)
{
    int res = 0;
    link_node *head = NULL;
    
    head = link_create(head ,5);
    printf("after create list,the list is:\n");
    link_traverse(head);
    
    res = node_insert(head,2,6);
    if(res)
    {
        printf("failure to insert");
        return -1;
    }
    printf("after insert node, the list is:\n");
    link_traverse(head);

    res = node_delete(head,2);
    if(res)
    {
        printf("failuer to delete");
        return -1;
    }
    printf("after delete node,the list is:\n");
    link_traverse(head);

    link_reverse(head);
    printf("after reverse list, the list is:\n");
    link_traverse(head);

    printf("now,destroy the list:\n");
    link_destroy(head);

    return 0;
}
